package com.cci.kangdao.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.mybatis.spring.annotation.MapperScan;
import com.cci.kangdao.dao.model.ActivateIOSUserPhoneTokenT;


/**
 * 唤醒IOS，绑定用户和手机tokenDao类
 *
 */
@MapperScan
public interface ActivateIOSUserPhoneTokenTDao {
	
	/**
	 * 通过userName获取绑定IOS手机的Token
	 * @param type
	 * @return
	 */
	@Select("select * from ActivateIOS_User_PhoneToken_T where UserName = #{userName}")
	public ActivateIOSUserPhoneTokenT getActivateIOSUserPhoneTokenTByUserName(String userName);
	
	@Insert("insert into ActivateIOS_User_PhoneToken_T(UserName,PhoneToken) values(#{UserName},#{PhoneToken})")
	public int insertActivateIOSUserPhoneTokenT(@Param("UserName")String UserName,@Param("PhoneToken")String PhoneToken);
	
	@Update("update ActivateIOS_User_PhoneToken_T set PhoneToken=#{PhoneToken} where UserName=#{UserName}")
	public int updateActivateIOSUserPhoneTokenT(@Param("UserName")String UserName,@Param("PhoneToken")String PhoneToken);
	
	@Delete("delete ActivateIOS_User_PhoneToken_T where UserName=#{UserName}")
	public int deleteActivateIOSUserPhoneTokenT(String userName);
	
	@Select("select * from ActivateIOS_User_PhoneToken_T")
	public List<ActivateIOSUserPhoneTokenT> getActivateIOSUserPhoneTokenTList();
}
